#ifndef __DECEMBER_H_
#define __DECEMBER_H_
#include<stdio.h>
#include <stdbool.h>

#define ElementType void*

struct December;

struct Telephone;

typedef struct December Dec;

typedef struct Telephone Tel;

bool IsNameEqual(void *p1, void *p2);

bool IsNumberEqual(void *p1, void *p2);

bool CompareName(void *p1, void *p2);

// bool GreatName(void *p1, void *p2);

// bool GreatName2(void *p1, void *p2);

Dec* InitDec(int capacity);

void InsertTail(Dec *Array, ElementType element);

void PrintArray(Dec *Array, void(*Print)(ElementType) );

ElementType* FindByElement(Dec *Array, ElementType element);

Tel* Search(Dec *Array, ElementType name);

void RemoveByArray(Dec *Array, ElementType element);

void FreeArray(Dec *Array, void(*Free)(ElementType));

//电话号码

Tel* InitTel(const char *name, const char *number);

void RemoveTel(Dec *Array,void *data, bool (*IsEqual)(void *, void *));

Tel* FindTel(Dec *Array, void *data, bool (*IsEqual)(void *, void *));

void FreeTel(void *ptr);

void PrintTel(void *ptr);

void Sort(Dec *a, bool(*Compare)(ElementType, ElementType));



#endif